<div class="right_side_operate_area">
	<?php  
		if($showpage==1) {
			if(isset($paging)){ echo $this->renderElement('pagination',$paging);} 
		}
	?>
	<div class="right search_box">
		<form onsubmit="return searchinfo()">
	    	<div class="left search_text">
	    		<?php echo $form->text('User.keyword',array('placeholder'=>'搜索昵称','value'=>$keyword, 'id'=>'search', 'class'=>'text_box'));?>
	    	</div>
	        <div class="left search_btn"><input type="submit" value=""/></div>
        </form>
        <div class="clear"></div>
    </div>
	<?php $cuser = $session->read('User'); ?>
    	<?php if($cuser['isadmin']){ ?>
		<div class="right item_add_btn"><?php echo $html->link('添加', 'add');?></div>
	<?php }else{
			echo '<div class="right enableaction">';
			echo "<a>添加</a>";
			echo '</div>';
		}
	 ?>
    <div class="clear"></div>
</div>
<div class="right_side_scollbar">
	<div class="detail_info_panel">
		<div class="items_list">
			<table>
				<tr>
					<th><?php __('Name');?></th>
					<th>联系邮箱</th>
			        <th><?php __("Position") ;?></th>
			        <th><?php __("Mobile") ;?></th>
			        <th><?php __("Action") ;?></th>
				</tr>
			<!-- Here is where we loop through our $posts array, printing out post info -->
			<?php 
				foreach ($users as $user): 
			?>
				<tr class="per_list">
					<td><div class="list_user_name">
					<?php 
					if($user['User']['isgroupadmin']){
						echo '<div class="admin_tag">';
						echo $html->image("user_admin.png");
						echo '</div>';
					}
					?>
					<span class="user_icon_s">
					<?php 
					echo $html->image($user["User"]["icon"],array("width"=>"34px","height"=>"34px"));
					 //if($user['Attachment']['file_path']){ 
					//	echo $html->image("/".$user['Attachment']['file_path']);
					 //}else{  
					 //	echo $html->image('men_tiny.jpg');
					 //	} 
					?>
					</span><span><?php echo $html->link($user['User']['name'],"/users/view/".$user['User']['id']) ;?></span><div class="clear"></div></div></td>
					<td><?php echo $user['User']['email']; ?></td>
					<td><?php echo $user['User']['position']; ?></td>
					<td><?php echo $user['User']['mobile']; ?></td>
					<td>
						<?php 
						if($cuser['isadmin']){
						echo $html->link(__('Edit',true),"/users/edit/".$user['User']['id']);
						}else{
							echo "<span class='enableaction'>编辑</span>";
						}
						if($cuser['isadmin']){
						echo $html->link(__('Delete',true), array('action' => 'delete', $user['User']['id']), array("onclick"=>"return doaction(this)")); 
						}else{
							echo "<span class='enableaction'>删除</span>";
						}
						?> 
					</td>
				</tr>
			<?php 
				endforeach; 
			?>
			</table>
		</div>
	</div>
</div>
<?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>